Skip to content

Conversation

@jburnt
Copy link
Contributor

@jburnt jburnt commented Oct 1, 2025

No description provided.

@jburnt jburnt changed the title Feat/marketplace asset marketplace Oct 1, 2025
@jburnt jburnt marked this pull request as ready for review October 17, 2025 05:35
@emperorjm
Copy link
Contributor

This marketplace contract needs to be enhanced to support Crossmint secondary sales. Crossmint requires the ability to purchase NFTs on behalf of end users, where Crossmint pays for the transaction but the NFT is delivered directly to the customer's wallet.

The existing BuyItem message (contracts/marketplace/src/msg.rs:20-23) only allows users to purchase NFTs for themselves:

BuyItem {
    listing_id: String,
    price: Coin,
},

The current implementation in execute_buy_item (contracts/marketplace/src/contract.rs:212-249) always transfers the NFT to info.sender (the message sender).

A new FinishFor message variant that allows a third party (Crossmint) to pay for the NFT while sending it to a different recipient address.

@@ -0,0 +1,2535 @@
use anyhow::Error;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be broken down into more specific files. It is currently unwieldy

pub listing_denom: String,
}

// Maximum fee bps allowed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"bps" needs to be defined somewhere

}

#[cfg_attr(not(feature = "library"), cosmwasm_std::entry_point)]
pub fn execute(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nit, but if we pulled query into it's own file, why not execute?

// remove listing
listings().remove(deps.storage, listing_id.clone())?;

let buy_msg = asset_buy_msg(info.sender.clone(), listing.token_id.clone());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @emperorjm mentioned, this requires the buyer to be the msg sender. This will not work for things like crossmint, gift purchasing, etc. Like the buy handler for the asset, we should accept an optional receiver, and if it is unset, use the info.sender

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this logic seems to have no enforcement of marketplace fees. How do the marketplace and asset work together for fees?

listing.token_id.clone(),
price,
None,
None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add fee info here?

pub fee_recipient: T,
pub sale_approvals: bool,
pub fee_bps: u64,
pub listing_denom: String,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that marketplaces can only list in one denom, which is probably fine for the first version. In the future, we will need to figure out how to reason about multi-denom marketplaces

@Peartes Peartes merged commit 7fdaf55 into feat/xion-asset Oct 28, 2025
0 of 2 checks passed
@Peartes Peartes deleted the feat/marketplace branch October 28, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants